package main

import (
	"fmt"
	"sync"
	"time"
)

var wg sync.WaitGroup
var ch chan int
var chs chan string

func echo(name string) {
	defer wg.Done()
	for i := 0; i < 10; i++ {
		fmt.Println(name, i)
		time.Sleep(time.Millisecond)
	}
}

func bing() {
	wg.Add(2)
	go echo("A:")
	go echo("B:")
	wg.Wait()
}

func main() {
	bing()
}
